using System;
using System.Collections.Generic;
using System.Text;
using BusinessObjects.BO_Actions.Guest_Log;
using Entity.StoreProcedure;
using BusinessObjects;
using System.Data;
namespace BusinessObjects.BO_GetObjects
{
    public static class BO_Guest_Log
    {
        public static DataTable SelectAll(int status)
        {
            try
            {
                BOGuest_Log_Select_All action = new BOGuest_Log_Select_All();
                usp_Guest_Log_Select_All entity = new usp_Guest_Log_Select_All();
                entity.STATUS = status;
                return action.ExecuteAndReturnDataTable(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static DataTable SelectTop(int rows, int status)
        {
            try
            {
                BOGuest_Log_Select_Top action = new BOGuest_Log_Select_Top();
                usp_Guest_Log_Select_Top entity = new usp_Guest_Log_Select_Top();
                entity.NUMBERRECORD = rows;
                entity.STATUS = status;
                return action.ExecuteAndReturnDataTable(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static DataTable Search(int guest_log_id)
        {
            try
            {
                BOGuest_Log_Search action = new BOGuest_Log_Search();
                usp_Guest_Log_Search entity = new usp_Guest_Log_Search();
                entity.GUEST_LOG_ID = guest_log_id;
                return action.ExecuteAndReturnDataTable(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static DataTable SelectWithPaged(int startIndex, int pageCount, int status, int guest_id)
        {
            try
            {
                BOGuest_Log_Select_WithPaged action = new BOGuest_Log_Select_WithPaged();
                usp_Guest_Log_Select_WithPaged entity = new usp_Guest_Log_Select_WithPaged();
                entity.STARTINDEX = startIndex;
                entity.MAXRECORDS = pageCount;
                entity.STATUS = status;
                entity.GUEST_ID = guest_id;
                return action.ExecuteAndReturnDataTable(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static string Insert(Int64 guest_id, string page_view, int total_view, DateTime first_access, DateTime last_access, int sort_display, string created_by, DateTime modify_date, string modify_by, bool status)
        {
            try
            {
                BOGuest_Log_Insert action = new BOGuest_Log_Insert();
                usp_Guest_Log_Insert entity = new usp_Guest_Log_Insert();
                entity.GUEST_ID = guest_id;
                entity.PAGE_VIEW = page_view;
                entity.TOTAL_VIEW = total_view;
                entity.FIRST_ACCESS = first_access;
                entity.LAST_ACCESS = last_access;
                entity.SORT_DISPLAY = sort_display;
                entity.CREATED_BY = created_by;
                entity.MODIFY_DATE = modify_date;
                entity.MODIFY_BY = modify_by;
                entity.STATUS = status;
                return action.ExecuteAndReturnStringValue(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static string Update(Int64 guest_log_id, Int64 guest_id, string page_view, int total_view, DateTime first_access, DateTime last_access, int sort_display, string created_by, DateTime modify_date, string modify_by, bool status)
        {
            try
            {
                BOGuest_Log_Update action = new BOGuest_Log_Update();
                usp_Guest_Log_Update entity = new usp_Guest_Log_Update();
                entity.GUEST_LOG_ID = guest_log_id;
                entity.GUEST_ID = guest_id;
                entity.PAGE_VIEW = page_view;
                entity.TOTAL_VIEW = total_view;
                entity.FIRST_ACCESS = first_access;
                entity.LAST_ACCESS = last_access;
                entity.SORT_DISPLAY = sort_display;
                entity.CREATED_BY = created_by;
                entity.MODIFY_DATE = modify_date;
                entity.MODIFY_BY = modify_by;
                entity.STATUS = status;
                return action.ExecuteAndReturnStringValue(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static bool Delete(int guest_log_id)
        {
            try
            {
                BOGuest_Log_Delete action = new BOGuest_Log_Delete();
                usp_Guest_Log_Delete entity = new usp_Guest_Log_Delete();
                entity.GUEST_LOG_ID = guest_log_id;
                return action.ExecuteAndReturnBooleanValue(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static bool Restore(int guest_log_id)
        {
            try
            {
                BOGuest_Log_Restore action = new BOGuest_Log_Restore();
                usp_Guest_Log_Restore entity = new usp_Guest_Log_Restore();
                entity.GUEST_LOG_ID = guest_log_id;
                return action.ExecuteAndReturnBooleanValue(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
}

